Use Docker Compose v2 (docker compose) in the compose log collector#148
Merged
Conversation
The compose collector shells out to `docker-compose -f ... -p ... ps -q ...` (Compose v1) to locate containers for log collection. GitHub-hosted `ubuntu-24.04` runners no longer ship the standalone `docker-compose` (v1) binary, so collection fails with `docker-compose: command not found` on every failed e2e (setup already uses Compose v2 via testcontainers-go, so only the collector was still on v1). Switch `ComposeCommand` from `docker-compose` to `docker compose`. The command is run via `bash -ec`, so the two-word v2 plugin invocation works as-is, and v2 accepts the same `-f / -p / ps -q` flags. Validated locally with a compose e2e (nginx): with `docker-compose` v1 absent (and with a failing `docker-compose` stub shadowing PATH), `e2e run` completes green and the collector gathers container files via `docker compose` v2 without ever invoking `docker-compose`.
infra-e2e's own e2e (`test/e2e/e2e.yaml`) runs on `ubuntu-latest` (which ships only Docker Compose v2) but never exercised the compose log collector, so the v1->v2 breakage slipped through CI and the prior fix had no regression guard. Add a `cleanup.collect` config (httpbin / /etc/hostname) and a verify case that runs `e2e collect` against the already-running stack and asserts a container file was gathered. The collector now runs in CI on a v1-less runner, proving it works via `docker compose` v2 and failing the build if it ever regresses to `docker-compose` v1. Validated locally: `e2e collect` gathers /etc/hostname from the httpbin service and the verify case reports `1 passed`.
There was a problem hiding this comment.
license-eye has totally checked 400 files.
| Valid | Invalid | Ignored | Fixed |
|---|---|---|---|
| 97 | 1 | 302 | 0 |
Click to see the invalid file list
- test/e2e/collect-expected.yaml
kezhenxu94
approved these changes
Jun 18, 2026
wu-sheng
added a commit
to apache/skywalking
that referenced
this pull request
Jun 18, 2026
GitHub-hosted runners (ubuntu-24.04) ship only Docker Compose v2 and no longer provide the legacy docker-compose v1 binary, so the infra-e2e log collector failed on current runners. Bump the pinned infra-e2e action from 0d91769 to 68bbdec (apache/skywalking-infra-e2e#148), which switches the collector to 'docker compose', restoring e2e container-log collection.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix
docker-compose: command not foundin the compose log collector on modern runnersWhy now
GitHub deprecated and removed Docker Compose v1 (the standalone
docker-composebinary) from its hosted Ubuntu runner images — see the deprecation notice and actions/runner-images#9692. Currentubuntu-latest/ubuntu-24.04images ship only Docker Compose v2 (docker compose);docker-composeis gone (actions/runner-images#9864). So any workflow on those images hits this in the collector:(observed in Apache SkyWalking's e2e — container logs were never collected on failures, making CI failures much harder to debug).
Problem
setupalready uses Compose v2 (viatestcontainers-go/modules/compose); only the log collector still shelled out to v1.internal/constant/compose.godefinesComposeCommand = "docker-compose", used bycollector.findComposeContainer→docker-compose -f … -p … ps -q …. It's the onlydocker-composereference in the repo, and it's executed viabash -ec.Fix
Run via
bash -ec, the two-word v2-plugin invocation works as-is, and v2 accepts the same-f / -p / ps -qflags.CI coverage (why this wasn't caught — now fixed)
infra-e2e's own e2e (
test/e2e/e2e.yaml) runs onubuntu-latest(no v1) but never exercised the collector — so it neither caught the breakage nor would validate this fix. This PR adds acleanup.collectconfig + a verify case that runse2e collectagainst the running stack and asserts a container file was gathered. The collector now runs in CI on a v1-less runner — proving it works viadocker composev2 and failing the build if it ever regresses to v1.Validation (local)
A compose e2e (
nginx) and the new httpbin guard, built binary, run with:docker-composev1 hidden, and a failingdocker-composestub shadowing PATH;→
e2e run/e2e collectcomplete green and the collector gathersinspect.json+ a container file viadocker composev2, while the stub is never invoked. The new verify case reports1 passed.